VERSION 5.00
Begin VB.Form HIVMenuForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer2 
      Interval        =   1000
      Left            =   11520
      Top             =   2040
   End
   Begin VB.Timer Timer3 
      Interval        =   20000
      Left            =   11520
      Top             =   2640
   End
   Begin VB.CommandButton MainMenu_Button 
      Height          =   735
      Left            =   1800
      TabIndex        =   4
      Top             =   6000
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Secure the workstation"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   7200
      TabIndex        =   0
      Top             =   360
      Width           =   4215
   End
   Begin VB.CommandButton TestClient_Button 
      Height          =   735
      Left            =   1800
      TabIndex        =   1
      Top             =   2760
      Width           =   975
   End
   Begin VB.CommandButton ControlTest_Button 
      Height          =   735
      Left            =   1800
      TabIndex        =   2
      Top             =   3840
      Width           =   975
   End
   Begin VB.CommandButton DailyReport_Button 
      Height          =   735
      Left            =   1800
      TabIndex        =   3
      Top             =   4920
      Width           =   975
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   6
      Left            =   7860
      TabIndex        =   25
      Top             =   7500
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   5
      Left            =   7860
      TabIndex        =   24
      Top             =   7020
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   4
      Left            =   7860
      TabIndex        =   23
      Top             =   6540
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   3
      Left            =   7860
      TabIndex        =   22
      Top             =   6060
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   2
      Left            =   7860
      TabIndex        =   21
      Top             =   5580
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   1
      Left            =   7860
      TabIndex        =   20
      Top             =   5100
      Width           =   2295
   End
   Begin VB.Label TestName 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Test"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Index           =   0
      Left            =   7860
      TabIndex        =   19
      Top             =   4620
      Width           =   2295
   End
   Begin VB.Label PastedControlsTitle 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Tests Passed Control"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   7620
      TabIndex        =   18
      Top             =   4080
      Width           =   2895
   End
   Begin VB.Label Label3 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Records on Server:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   7800
      TabIndex        =   17
      Top             =   3240
      Width           =   2055
   End
   Begin VB.Label RecCount_Data 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   9840
      TabIndex        =   16
      Top             =   3240
      Width           =   1095
   End
   Begin VB.Label ClientTestedToday_Label 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   10080
      TabIndex        =   15
      Top             =   2760
      Width           =   855
   End
   Begin VB.Label Label5 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Clients Tested Today:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   7800
      TabIndex        =   14
      Top             =   2760
      Width           =   2295
   End
   Begin VB.Label SystemStat_Label 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "System Statistics"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   7560
      TabIndex        =   13
      Top             =   2160
      Width           =   2295
   End
   Begin VB.Label Label2 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Main Menu"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   615
      Left            =   3060
      TabIndex        =   12
      Top             =   6120
      Width           =   2295
   End
   Begin VB.Label Clock_Label 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Time"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   11
      Top             =   840
      Width           =   2535
   End
   Begin VB.Label UserName_Label 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Username goes here ..."
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   10
      Top             =   360
      Width           =   5775
   End
   Begin VB.Label Date_Label 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   9
      Top             =   840
      Width           =   3255
   End
   Begin VB.Label TestClient_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Test Client"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3060
      TabIndex        =   8
      Top             =   2880
      Width           =   2295
   End
   Begin VB.Label HIVTesting_Label 
      BackColor       =   &H00FFC0C0&
      Caption         =   "HIV Testing"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   24
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   1320
      TabIndex        =   7
      Top             =   2040
      Width           =   4455
   End
   Begin VB.Label ControlTest_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Control Test"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3060
      TabIndex        =   6
      Top             =   3960
      Width           =   2115
   End
   Begin VB.Label BlankForm_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Daily Report"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3060
      TabIndex        =   5
      Top             =   5100
      Width           =   2775
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00FFC0C0&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      Height          =   7155
      Left            =   480
      Top             =   1620
      Width           =   6375
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      FillColor       =   &H00FFFFFF&
      Height          =   1095
      Left            =   480
      Shape           =   4  'Rounded Rectangle
      Top             =   240
      Width           =   6375
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00E0E0E0&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      Height          =   7155
      Left            =   7200
      Top             =   1620
      Width           =   4215
   End
End
Attribute VB_Name = "HIVMenuForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
   LoginForm.Show
   Unload Me
End Sub

Private Sub ControlTest_Button_Click()
   ControlForm.Show
   Unload Me
End Sub

Private Sub DailyReport_Button_Click()
   LabReportForm.Show
   Unload Me
End Sub

Private Sub Form_Load()
   Dim I, J As Integer

   Date_Label.Caption = "Date: " & StringDate
   Clock_Label.Caption = "Time: " & Time
   UserName_Label.Caption = "User: " + TrimAll(UserFirst) + " " + TrimAll(UserLast)
   
   If ORGANIZATION = "LIGHTHOUSE" Then 'just enable the test button
      TestClient_Button.Enabled = True
      TestClient_Label.Enabled = True
      PastedControlsTitle.Visible = False
      For I = 0 To 6
         TestName(I).Visible = False
      Next I
      ControlTest_Button.Enabled = False
      ControlTest_Label.Enabled = False
   Else
      For I = 0 To 6
         TestName(I).Caption = ""
      Next I
      'Get the controls for today
      CnUser.Open ConnectString
      Cmd.CommandText = "SELECT TEST_NAME" & _
                      " FROM rapidtest" & _
                      " WHERE CTRL_DATE = '" & StringDate & "'" & _
                      " AND POS_RESULT = 'Reactive' AND NEG_RESULT = 'Non-Reactive'"
      Cmd.CommandType = adCmdText
      Cmd.ActiveConnection = CnUser
      RsUser.Open Cmd, , adOpenStatic
      If RsUser.EOF = True Then
         TestName(0).Caption = "No controls run today"
   '      TestClient_Button.Enabled = False
   '      TestClient_Label.Enabled = False
      Else
         J = 0
         While RsUser.EOF = False
            TestName(J).Caption = RsUser(0)
            J = J + 1
            RsUser.MoveNext
         Wend
      End If
      RsUser.Close
      CnUser.Close
      If J >= 2 Then 'at least 2 controls have been run so a test can be performed
         TestClient_Button.Enabled = True
         TestClient_Label.Enabled = True
      Else
         TestClient_Button.Enabled = False
         TestClient_Label.Enabled = False
      End If
   End If
    
   'Get the current record count on the server
   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT COUNT(*)" _
                  & " FROM   client"
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
   RecCount_Data.Caption = RsUser(0)
   RsUser.Close
   CnUser.Close
   
   'Get the record count of clients tested today
   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT COUNT(*)" _
                  & " FROM   client" _
                  & " WHERE  VDATE = '" & StringDate & "'" _
                  & " AND HIV IS NOT NULL"
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
   ClientTestedToday_Label.Caption = RsUser(0)
   RsUser.Close
   CnUser.Close
   
End Sub

Private Sub MainMenu_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub TestClient_Button_Click()
   HIVClientForm.Show
   Unload Me
End Sub

Private Sub Timer2_Timer()
   Clock_Label.Caption = "Time: " & Time
End Sub

Private Sub Timer3_Timer()
   Date_Label.Caption = "Date: " & StringDate
End Sub
